/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FuncionesPotencia.java
 *
 * Created on 02-sep-2011, 11:52:39
 */

package Fronteras;

import Controles.ControlFrame;
import javax.swing.JOptionPane;

/**
 *
 * @author VIVIANAGUZMAN-257580
 */

@SuppressWarnings("serial")
public class FuncionesPotencia extends javax.swing.JPanel {

    /** Creates new form FuncionesPotencia */
    public FuncionesPotencia() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        BExponencial = new javax.swing.JButton();
        BLogaritmo = new javax.swing.JButton();
        BPotencia = new javax.swing.JButton();
        JTBase = new javax.swing.JTextField();
        JTExponente = new javax.swing.JTextField();

        jLabel1.setText("FUNCIONES POTENCIA");

        jLabel2.setText("Ingrese la Base ");

        jLabel3.setText("Ingrese el Exponente");

        BExponencial.setText("Exponencial");
        BExponencial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BExponencialActionPerformed(evt);
            }
        });

        BLogaritmo.setText("Logaritmica");
        BLogaritmo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BLogaritmoActionPerformed(evt);
            }
        });

        BPotencia.setText("Potencia");
        BPotencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BPotenciaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(24, 24, 24)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(BExponencial)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel3)))
                            .addGap(45, 45, 45)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(BLogaritmo)
                                .addComponent(JTExponente, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(JTBase, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(119, 119, 119)
                        .addComponent(BPotencia, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(106, 106, 106)
                        .addComponent(jLabel1)))
                .addContainerGap(58, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel3)
                    .addComponent(JTExponente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BExponencial)
                    .addComponent(BLogaritmo))
                .addGap(33, 33, 33)
                .addComponent(BPotencia)
                .addContainerGap(45, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void BExponencialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BExponencialActionPerformed
      String a;
      a=JTBase.getText();
      double eul=Double.parseDouble(a);
      ControlFrame Operator= new ControlFrame() ;
      JOptionPane.showMessageDialog(null, "La Exponencial\n " + Operator.Euler(eul) );
    }//GEN-LAST:event_BExponencialActionPerformed

    private void BLogaritmoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BLogaritmoActionPerformed
      String a;
      a=JTBase.getText();
      double log=Double.parseDouble(a);
      ControlFrame Operator= new ControlFrame() ;
      JOptionPane.showMessageDialog(null, "El Logartimo Natural es\n " + Operator.Logaritmo(log) );
    }//GEN-LAST:event_BLogaritmoActionPerformed

    private void BPotenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BPotenciaActionPerformed
      String a;
      String b;
      a=JTBase.getText();
      b=JTExponente.getText();
      double bas=Double.parseDouble(a);
      double exp=Double.parseDouble(b);
      ControlFrame Operator= new ControlFrame() ;
      JOptionPane.showMessageDialog(null, "La Potencia es es\n " + Operator.Potencia(bas,exp) );
    }//GEN-LAST:event_BPotenciaActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BExponencial;
    private javax.swing.JButton BLogaritmo;
    private javax.swing.JButton BPotencia;
    private javax.swing.JTextField JTBase;
    private javax.swing.JTextField JTExponente;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    // End of variables declaration//GEN-END:variables

}
